package com.ruibang.glass.produce.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-11-22  19:53
 * @Description: TODO:窑炉异常
 * @Version: 1.0
 */

@Data
@ApiModel
@TableName(value = "g_produce_process_abnormality")
public class ProcessAbnormality extends BaseEntity implements Serializable {
    @ApiModelProperty(value = "异常id")
    @TableId(value = "abnormality_id", type = IdType.ASSIGN_ID)
    private String abnormalityId;

    @ApiModelProperty("日期")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "日期不可为空！")
    private LocalDateTime date;

    @ApiModelProperty("工序名称")
    @NotBlank(message = "工序名称不可为空！")
    private String processName;

    @ApiModelProperty(value = "班组")
    private String teamGroup;

    @ApiModelProperty("班次")
    @NotBlank(message = "班次不可为空！")
    private String classes;

    @ApiModelProperty("记录")
    private String record;

    @ApiModelProperty("处理措施")
    private String handlingMeasures;

    @ApiModelProperty("记录人用户ID")
    private String recorderUserId;

    @ApiModelProperty("处理人用户ID")
    private String handleUserId;

    @ApiModelProperty("更新人用户ID")
    private String updateUserId;

    @ApiModelProperty("备注")
    private String note;

    @ApiModelProperty("1：已处理，0：未处理")
    @NotBlank(message = "处理状态不可为空！")
    private String status;

    @ApiModelProperty("异常类型(1：配料异常、2：窑炉异常、3：通道异常、4：成型异常、5：BCP(半成品)异常、6：理化异常、7：投入异常、8：精切异常、9：研磨异常、10：清洗异常、11：检查异常、12：包装异常、13：洁净异常)")
    @NotBlank(message = "异常类型不可为空")
    private String type;

    @ApiModelProperty(value = "是否删除：1：是 0：否")
    @TableLogic
    private String isDelete;

    @ApiModelProperty("记录人用户名称")
    @TableField(exist = false)
    private String recorderUserName;

    @ApiModelProperty("处理人用户名称")
    @TableField(exist = false)
    private String handleUserName;

    @ApiModelProperty("更新人用户名称")
    @TableField(exist = false)
    private String updateUserName;
}
